﻿@using NewLife;
@using XCode;
@using XCode.Configuration;
@{
    var pair = Model as Pair;
    var entity = pair.First as IEntity;
    var item = pair.Second as FieldItem;

    //var width = 4;
    //switch (Type.GetTypeCode(item.Type))
    //{
    //    case TypeCode.Boolean:
    //        width = 4;
    //        break;
    //    case TypeCode.String:
    //        width = 8;
    //        break;
    //}
}
<label class="control-label col-xs-2">@item.DisplayName</label>
<div class="col-xs-10 input-group">
    @Html.ForEditor(item, entity)
    @Html.ForDescription(item)
    @if (ViewData.ModelState.ContainsKey(item.Name))
    {
        <span class="alert-danger">
            @Html.ValidationMessage(item.Name)
        </span>
    }
</div>